<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/11/24 0024
  Time: 下午 3:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>黑名单添加</title>
    <link rel="stylesheet" href="/static/plugins/layui/css/layui.css">
</head>
<body>
<%--黑名单添加弹出层--%>
<div id="add">
    <form id="formAdd">
        <div class="layui-form-item">
            <label class="layui-form-label">真实姓名:</label>
            <div class="layui-input-block">
                <input type="text" name="name" required  lay-verify="required" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">手机号码:</label>
            <div class="layui-input-block">
                <input type="text" name="mobile" required  lay-verify="required" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">身份证号:</label>
            <div class="layui-input-block">
                <input type="text" name="idCard" required  lay-verify="required" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">原因类型: </label>
            <div class="layui-input-block">
                <input type="text" name="reasonType" required  lay-verify="required" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">备注信息: </label>
            <div class="layui-input-block">
                <input type="text" name="remark" required  lay-verify="required" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">信息来源:</label>
            <div class="layui-input-block">
                <input type="text" name="sourceType" required  lay-verify="required" autocomplete="off" class="layui-input">
            </div>
        </div>
        <button id="save" type="button">保存</button>
        <button id="cancel" type="button">取消</button>
    </form>

</div>
</body>
</html>
<script src="/static/plugins/jquery.js"></script>
<script src="/static/plugins/layui/layui.js"></script>
<script>
    layui.use(['element','layer'], function(){
        var element = layui.element;
        var layer = layui.layer;


        $(function () {
            $("#formAdd").bind("submit", function () {
                var options = {
                    url: '/blackList/save',
                    type: 'post',
                    dataType: 'text',
                    data: $("#formAdd").serialize(),
                    success: function (data) {
                        layer.alert("添加成功"),{
                            time:2000,
                        };
                        parent.$("#tb_blackList").bootstrapTable("refresh");
                        var index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);
                    }
                };
                $.ajax(options);
                return false;
            })
        })
        $('#save').click(function(){
            $('#formAdd').submit();
        })
    })



</script>